home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / ccs / ccs-11tl.lha / lbl / include / ppmcmap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-20  |  1.3 KB  |  45 lines

  1. /* ppmcmap.h - header file for colormap routines in libppm
  2. */
  3.  
  4. /* Color histogram stuff. */
  5.  
  6. typedef struct colorhist_item* colorhist_vector;
  7. struct colorhist_item
  8.     {
  9.     pixel color;
  10.     int value;
  11.     };
  12.  
  13. typedef struct colorhist_list_item* colorhist_list;
  14. struct colorhist_list_item
  15.     {
  16.     struct colorhist_item ch;
  17.     colorhist_list next;
  18.     };
  19.  
  20. colorhist_vector ppm_computecolorhist ARGS(( pixel** pixels, int cols, int rows, int maxcolors, int* colorsP ));
  21. /* (Returns a colorhist *colorsP long (with space allocated for maxcolors). */
  22.  
  23. void ppm_addtocolorhist ARGS(( colorhist_vector chv, int* colorsP, int maxcolors, pixel* colorP, int value, int position ));
  24.  
  25. void ppm_freecolorhist ARGS(( colorhist_vector chv ));
  26.  
  27.  
  28. /* Color hash table stuff. */
  29.  
  30. typedef colorhist_list* colorhash_table;
  31.  
  32. colorhash_table ppm_computecolorhash ARGS(( pixel** pixels, int cols, int rows, int maxcolors, int* colorsP ));
  33.  
  34. int
  35. ppm_lookupcolor ARGS(( colorhash_table cht, pixel* colorP ));
  36.  
  37. colorhist_vector ppm_colorhashtocolorhist ARGS(( colorhash_table cht, int maxcolors ));
  38. colorhash_table ppm_colorhisttocolorhash ARGS(( colorhist_vector chv, int colors ));
  39.  
  40. int ppm_addtocolorhash ARGS(( colorhash_table cht, pixel* colorP, int value ));
  41.  
  42. colorhash_table ppm_alloccolorhash ARGS(( int ));
  43.  
  44. void ppm_freecolorhash ARGS(( colorhash_table cht ));
  45.